package com.kk.config;

import com.kk.util.result.Result;

/**
 * @author: kevin
 * @data: 2018-09-04 11:36
 * @desc:   自定义异常：运行时异常没有code所以自定义一个，须在代码中throw MyException(Result.error(status,msg))
 */
public class MyException extends RuntimeException {
    private Integer code;

    public Integer getCode() {
        return this.code;
    }
    public MyException(Result result) {
        super(result.getMsg());
        this.code = result.getStatus();
    }
}
